home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_300
/
331_01
/
ged.h
< prev
next >
Wrap
Text File
|
1990-06-13
|
16KB
|
378 lines
/*
HEADER: CUG000.01;
TITLE: header file for se.c;
DATE: 5/19/87;
FILENAME: GED.H;
AUTHORS: G. Nigel Gilbert, James W. Haefner, Mel Tearle G. Osborn;
*/
/*
e/qed/ged screen editor
(C) G. Nigel Gilbert, MICROLOGY, 1981
licensed for private non-profitmaking use 1983
August-December 1981
Modified: Aug-Dec 1984: BDS-C 'e'(vers 4.6a) to 'qe' (J.W. Haefner)
March 1985: BDS-C 'qe' to DeSmet-C 'qed' (J.W.Haefner)
May 1986: converted to ged - Mel Tearle
June 1990: G. Osborn
FILE: ged.h
PURPOSE: standard header file, #included in all function files
*/
/*
* All static variables and #defines were at one time in this file.
* Variables which are not truely global in function are being removed
* from here and placed in the individual files. Parameters which, though
* sometimes local, are useful for configuring the program without studying
* the details remain here. g.o.
*/
#define max(a,b) (a >= b) ? a : b
#define min(a,b) (a <= b) ? a : b
#define abs(x) (x >= 0) ? x : -x
#define VERSION "4.6b"
/* Microsoft 4.00 mixed memory model */
#define FAR far
#define HUGE huge
/* use the following two lines instead of the preceeding two if the compiler
* does not support mixed memory models. The empty definitions
* remove all occurences of the far and huge keyword, causing
* the small memory model to be used.
*/
/*
*#define FAR
*#define HUGE
*/
#define SECSIZ 512 /* file buffer definitions */
#define NSECTS 4
#define FILELEN 64 /* max length of file name */
#define JBUFSIZE 6 /* size of buffer required for longjumps, not used */
#define BUFFER 12 /* size of typeahead buffer */
#define FLIM 80 /* */
#define LLIM 255 /* max length of a line. count includes null marker */
#define FAIL -1
/* disc fail. This value is internal and compiler independent */
#define DFAIL -2
#define ENDCHAR 0x1a /* end of text file mark. automatic option on input */
#define ENDFILE -1 /* end of input file */
#define YES 1
#define NO 0
#define FALSE 0
#define TRUE 1
#define PREV -2
#define PAGEOVERLAP 0 /* overlap between pages with UP,DOWN-PAGE */
#define OFFWIDTH 1 /* horizontal scroll increment */
#define SHEIGHT 24 /* screen height */
#define SWIDTH 79 /* screen width */
#define NLINES 6 /* number of lines to skip at bottom of printer page */
#define PAGELEN 66 /* length of printer page, used in listfile() & roff() */
#define EMPOS 0 /* position of error message */
#define WAITPOS 0 /* position of cursor when searching/reading */
#define LNPOS 7 /* position of line number */
#define COLPOS 18 /* position of column number */
#define REPPOS 19
#define FNPOS 43 /* status line - position of file name */
#define TIMEPOS 72 /* position of current time */
#define BACKSP 0x08 /* backspace */
#define CTRL 0x1f /* last control char */
#define PARBIT 0x80 /* parity bit used as a flag by testkey() */
#define NKEYS 32 /* number of key codes */
#define HISTLEN 100 /* history stack of commands for undoing */
#define HISTINSERT 1 /* type of command on history stack */
#define HISTDELETE 2
#define HISTREPLACE 3
/* Internal key codes - recommended key assignments in brackets
*/
#define LEADIN 0 /* lead in chararacter to key codes -
ignored, but following key code parity set */
#define DOWNKEY 1 /* cursor down */
#define UPKEY 2 /* cursor up */
#define LEFTKEY 3 /* cursor left */
#define RIGHTKEY 4 /* cursor right */
#define RIGHTWKEY 5 /* cursor right one word (D) */
#define LEFTWKEY 6 /* cursor left one word (S) */
#define EOLKEY 7 /* cursor to end of line (E) */
#define BOLKEY 8 /* cursor to beginning of line (B) */
#define UPPAGE 9 /* scroll up a page (W) */
#define DOWNPAGE 10 /* scroll down a page (Z) */
#define BOFKEY 11 /* cursor to beginning of file (U) */
#define HOMEKEY 12 /* cursor to end of file (HOME) */
#define DELLEFT 13 /* delete char to left of cursor (DEL) */
#define DELRIGHT 14 /* delete char under cursor (G) */
#define DELLNKEY 15 /* delete cursor line (Y) */
#define DELWDKEY 16 /* delete word to right of cursor (T) */
#define JUMPKEY 17 /* jump to (X) */
#define CRSTILL 18 /* insert newline after cursor (N) */
#define QWIKKEY 19 /* quit (Q) */
#define WINDUP 20 /* window up one line */
#define TOPSCRKEY 1000 /*not fully implemented */
#define BOTSCRKEY 1001 /* */
#define POP 21
#define CPOP 22
#define BLOCKKEY 23 /* block operations (K) */
#define WINDDOWN 24 /* window down one line */
#define REPKEY 25 /* repeat last find/alter (L) */
#define INSKEY 26 /* char insert/replace */
#define OOPSKEY 27 /* restore unedited line (_) */
#define TAB 28 /* tab (I) */
#define RETRIEVE 29 /* retrieve last name etc entered here */
#define CR 30 /* return (M) */
#define ESCKEY 31 /* the magic escape key (ESC) */
#define HELPKEY 1002 /* not implemented. The F1 help key is implemeted. */
/* key codes + 0x80 (PARBIT) - used in scanning strings of ctrl chars */
#define LEFTKEY_P 131
#define DELLEFT_P 141
#define RETRIEVE_P 157
#define CR_P 158
#define ESCKEY_P 159
/* function keys */
#define F1KEY 210
#define F2KEY 211 /* f2 = search */
#define F3KEY 212 /* f3=backward */
#define F4KEY 213 /* f4=forward */
#define F5KEY 214
#define F6KEY 215
#define F7KEY 216
#define F8KEY 217
#define F9KEY 218 /* f9 exit */
#define F10KEY 219 /* f10 save */
/*
* The video parameters in this file were originally set for a Hercules
* video card, then changed for a VGA card with a NEC grey scale monitor.
* The UNDERLINE attribute was used for the status line on the Hercules
* card, but is not supported by the VGA card. The values selected in
* this version will work on all systems, but are not the best choices
* for any one system. The first four bits and the second four bits of
* the attribute byte are independently selected. Experiment with them.
*/
/*
* normal screen color/intensity. selected by a call to colornorm()
*/
#define ATTR0 0x07 /* PC default. White on black.*/
/* a screen attribute used like highlighting or italics.
* The significance to the program is that it is abnormal, not whether it
* is bright or dim. On the PC it is brighter than normal.
* Selected by a call to color1();
*/
#define ATTR1 0x0F /* bright white on black */
/* Reverse field. Used for marking blocks and for error messages. Affects
* whitespace so that the spaces within block boundaries can be seen.
* Selected by a call to colorblock(). Also selected by colorerr(); in
* this version. (0x70 and 0x78 are the only codes which will reverse
* field a PC monochrome display, excluding colored error messages if
* compatibility is a consideration).
*/
#define ATTR2 0x70 /* reverse field, normal intensity */
/* Was used only to underline the header to seperate it from the
* text. Could also be used for conventional underlining of text.
*/
/* #define ATTR3 0x01 */ /* normal intensity, underlined (Hercules & other early cards) */
/* vga, temporary +++ */
#define ATTR3 0x70
/*#define ATTR4 0x09 */ /* bright and underlined (Hercules) */
/* vga grey scale for header, temporary +++ */
#define ATTR4 0x60
/* Virtual memory constants. The following are sized with a fixed
* disc system and 640kb of RAM in mind. There is a small memory savings in
* reducing the magnitude of the constants for smaller systems,
* but, other than for optimizaton, it is not nec